package clientapp;

import java.util.Calendar;
import java.util.GregorianCalendar;
import serverapp.Player;

/**
 *
 * @author a
 */
public class ImportPlayer {

    public void PlayerToPanel(playerPanel aPanel, Player aPlayer) {
        Calendar calendar = GregorianCalendar.getInstance();
        String date = calendar.getTime().toString();
        aPanel.nameLabel.setText(aPlayer.name);
        aPanel.surnameLabel.setText(aPlayer.surname);
        aPanel.nationalityLabel.setText(aPlayer.nationality);
        aPanel.ageLabel.setText(Integer.toString(aPlayer.age));
        aPanel.clubLabel.setText(aPlayer.club);
        aPanel.positionLabel.setText(aPlayer.position);
        aPanel.heightLabel.setText(Integer.toString(aPlayer.height));
        aPanel.weightLabel.setText(Integer.toString(aPlayer.weight));
        aPanel.attRangeLabel.setText(Integer.toString(aPlayer.attRange));
        aPanel.defRangeLabel.setText(Integer.toString(aPlayer.defRange));
        aPanel.dateLabel.setText(date);
        ClientView.tabbedPane.addTab(Integer.toString(aPlayer.number), aPanel);
    }
}
